import { requestClient } from '#/api/request';

// 获取分类,分类类型需要传递type
export async function $getlist(data: any) {
  return requestClient.get<any>('app/category', { params: data });
}

// 创建分类
export async function $createlist(data: any) {
  return requestClient.post<any>('app/category', data);
}


// 更新分类
export async function $updateclass(data: any, id: any) {
  return requestClient.put<any>(`app/category/${id}`, data);
}


// 删除分类
export async function $deleteclass(data: any, id: any) {
  return requestClient.delete<any>(`app/category/${id}`, data);
}


// 获取级联分类数据
export async function $getalllist(data: any) {
  return requestClient.get<any>('app/category/cascader', { params: data });
}
